<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>原型链图</title>
	</head>
	<body>
		<script>
			//构造函数
			function Persion(nation,skinColor){
				this.nation=nation;
				this.skinColor=skinColor;
			}
			Persion.prototype.sayinfo=function(){//父类的方法
//				alert("国籍是"+this.nation+"\n"+"肤色是："+this.skinColor);
				document.write("民族是:"+this.nation+"<br />"+"肤色是："+this.skinColor+"<br />");
			}
			//向子类对象中 添加sex属性
			function Won1(nation,skinColor,sex){
				Persion.call(this,nation,skinColor);//继承属性父类对象的属性
				this.sex=sex;//子类添加的属性
			}
			//继承方法
			Won1.prototype=new Persion();
			Won1.prototype.saysex=function(){
//				alert("性别是"+this.sex);
				document.write("性别是:"+this.sex);
			}
			var won=new Won1("汉族","黄色","男");
		</script>
	</body>
</html>
